<template>
  <div>
      <cart-one id="box" :sex="sex" :hobby="hobby" :age="age" :myname="fname"
      @click="say" @mouseover="run" 
      @sendmsg="getData" >
        <template #myheader>
          <div>
              <h1>我是头部</h1>
          </div>
        </template>
       <template #mynav>
          <div>
              <h1>我是导航</h1>
          </div>
        </template>
    </cart-one>
  </div>
</template>

<script>
import cartOne from './cartOne'
export default {
  name: '2209vueIndex',
  components:{
    cartOne
  },
  data() {
    return {
      fname:"小王",
      age:18,
      sex:"男",
      hobby:["玩游戏","打台球","躺平"]
    };
  },

  mounted() {
    
  },

  methods: {
    say(){},
    run(){},
    getData(){
      console.log("子组件通过$listeners触发了")
    }
  },
};
</script>